package xin.nick.bot;

import love.forte.common.configuration.Configuration;
import love.forte.simbot.annotation.SimbotApplication;
import love.forte.simbot.api.sender.BotSender;
import love.forte.simbot.bot.Bot;
import love.forte.simbot.core.SimbotApp;
import love.forte.simbot.core.SimbotContext;
import love.forte.simbot.core.SimbotProcess;
import org.jetbrains.annotations.NotNull;
import java.time.LocalDateTime;

/**
 * @author: Nick inickning@outlook.com
 * @Date: 2021/3/31 20:37
 * @Description:
 */
@SimbotApplication
public class MyBotApp implements SimbotProcess {
    public static void main(String[] args) {
        SimbotApp.run(MyBotApp.class, args);
    }

    @Override
    public void post(@NotNull SimbotContext context) {
        Bot bot = context.getBotManager().getDefaultBot();
        BotSender sender = bot.getSender();


        sender.SENDER.sendPrivateMsg("228919961", "我好了 - " + LocalDateTime.now());

//        sender.SENDER.sendPrivateMsg("228919961", "[CAT:rich," +
//                "content={\"app\":\"com.tencent.miniapp\"&#44;\"desc\":\"\"&#44;\"view\":\"all\"&#44;\"ver\":\"1.0.0.89\"&#44;\"pro" +
//                "mpt\":\"" +
//                "我好了" +
//                "\"&#44;\"meta\":{\"all\":{\"buttons\":&#91;{\"action\":\"http:\\/\\/www.qq.com\"&#44;\"name\":\"" +
//                "开机啦" +
//                "\"}&#93;&#44;\"jumpUrl\":\"\"&#44;\"preview\":\"https://upoos.nick.xin/images/nick.jpg\"&#44;\"summary\":\"" +
//                LocalDateTime.now() +
//                "\"&#44;\"title\":\"我好了\"}}&#44;\"config\":{\"forward\":true}}]" );

//        sender.SENDER.sendPrivateMsg("228919961", "[CAT:rich," +
//                "content={" +
//                "\"app\":\"com.tencent.gxhServiceIntelligentTip\"&#44;" +
//                "\"desc\":\"\"&#44;\"view\":\"gxhServiceIntelligentTip\"&#44;" +
//                "\"ver\":\"\"&#44;" +
//                "\"prompt\":\"&#91;QQ红包&#93;您收到一个红包\"&#44;\"meta\":{\"gxhServiceIntelligentTip\":{" +
//                "\"bgImg\":\"http://ptlogin2.qq.com/ho_cross_domain?tourl&#61;https://gxh.vip.qq.com\\/qqshow\\/admindata\\/comdata\\/vipActTpl_mobile_hbjnjl\\/3e884f98a7374c7d659100a101f3380c.gif\"&#44;" +
//                "\"appid\":\"gxhServiceIntelligentTip\"&#44;\"reportParams\":{}&#44;" +
//                "\"action\":\"https://nick.xin/\"}}&#44;\"config\":{\"forward\":1&#44;\"type\":\"normal\"&#44;\"width\":180&#44;\"autoSize\":0&#44;\"height\":240}}]\n" );
//

    }

    @Override
    public void pre(@NotNull Configuration config) {

    }
}
